import React from 'react'
// import {loaction} from 'history'
class List extends React.Component{
    goTo(index) {
        console.log(index)
        this.props.history.push('/detail/' + index)
    }
    render() {
        const arr=[1,2,3]
        return (
            <ul>
                {arr.map((item,index) => {
                    return <li key={index} onClick={this.goTo.bind(this, index+1)}>go to detail {item}</li>
                })}
            </ul>
        )
    }
}
export default List